home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / C64 / U-Utilities / (c)u1.d64 / copy files.c (.txt) < prev    next >
Commodore BASIC  |  2007-02-04  |  3KB  |  109 lines

  1. 100 POKE55,0:POKE56,24:CLR
  2. 101 PG=24:MX=PEEK(56)
  3. 102 Z$=CHR$(0):Q$=CHR$(34)
  4. 103 POKE53280,15:POKE53281,1
  5. 104 PRINTCHR$(14);CHR$(8)
  6. 105 DIMF$(MX),F(MX),T(MX)
  7. 106 FORI=828TO904:READA:POKEI,A:NEXT
  8. 107 PRINT"[147][144][211][201][206][199][204][197] [196][201][211][203] [198][201][204][197] [195][207][208][201][197][210]                 ";
  9. 108 PRINT"[163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]";
  10. 109 PRINT"[208]LEASE INSERT THE [211][207][213][210][195][197][144]  DISKETTE INTO"
  11. 110 PRINT"THE DISK DRIVE AND PRESS THE [210][197][212][213][210][206][146] KEY"
  12. 111 GETA$:IFA$<>CHR$(13)THEN111
  13. 112 OPEN15,8,15,"I0"
  14. 113 INPUT" [198]ILENAMES TO MATCH ? *[157][157][157]";F$
  15. 114 IFRIGHT$(F$,1)<>"*"THENF$=F$+"*"
  16. 115 GOSUB193:IFEGOTO189
  17. 116 OPEN1,8,0,"$0:"+F$:GOSUB193
  18. 117 IFETHENPRINT"[154] IMPOSSIBLE TO READ DIRECTORY [146]":GOTO189
  19. 118 PRINT" '[195][144]' TO COPY FILE    '[210][144]' TO REJECT FILE  ";
  20. 119 PRINT"'[194][144]' TO BEGIN COPY   '[193][144]' TO ABORT COPY"
  21. 120 GET#1,A$,B$:N=0:AD=PG*256
  22. 121 GET#1,A$,B$:IFB$=""GOTO142
  23. 122 GET#1,A$,B$:F$=""
  24. 123 SZ=ASC(A$+Z$)+ASC(B$+Z$)*256
  25. 124 GET#1,A$:IF64ANDSTGOTO142
  26. 125 IFA$<>Q$GOTO124
  27. 126 GET#1,A$:IFA$<>Q$THENF$=F$+A$:GOTO126
  28. 127 GET#1,A$:IFA$<>" "GOTO127
  29. 128 GET#1,T$:IFT$=" "GOTO128
  30. 129 GET#1,A$:IFA$<>""GOTO129
  31. 130 IFSZ=0OR(T$<>"P"ANDT$<>"S")GOTO121
  32. 131 PRINTSZ;TAB(5);T$;" ";Q$;F$;Q$;TAB(26);
  33. 132 IFAD+SZ*256>53247THENPRINT"[212][207][207] [204][193][210][199][197][144]":GOTO121
  34. 133 PRINT"_ C:R:B:A?[146][157][157][157][157][157][157][157][157]";
  35. 134 GETA$:IFA$=""GOTO134
  36. 135 IFA$="R"THENPRINT"[154]REJECT FILE[144]":GOTO121
  37. 136 IFA$="B"THENPRINT"[154]BEGIN COPY[144]":GOTO142
  38. 137 IFA$="A"THENPRINT"[154]ABORT COPY[144]":GOTO186
  39. 138 IFA$<>"C"GOTO134
  40. 139 N=N+1:F$(N)=F$+","+T$:PRINT"[154]COPY FILE[144] "
  41. 140 AD=AD+SZ*256:IFN<MXGOTO121
  42. 141 PRINT" [205]AXIMUM OF";MX;"FILES."
  43. 142 CLOSE1:PRINT"";N;"FILES TO READ"
  44. 143 AD=PG*256:IFN=0GOTO189
  45. 144 FORI=1TON
  46. 145 PRINT" ";Q$;F$(I);Q$;TAB(20);
  47. 146 SZ=INT(AD/256)
  48. 147 POKE251,AD-SZ*256:POKE252,SZ
  49. 148 OPEN1,8,2,"0:"+F$(I):GOSUB193
  50. 149 IFE=74THENCLOSE1:N=I-1:GOTO157
  51. 150 IFETHENCLOSE1:F$(I)="":GOTO156
  52. 151 SYS831:GOSUB193:CLOSE1:IFE=74THENN=I-1:GOTO157
  53. 152 IFETHENF$(I)="":GOTO156
  54. 153 IFPEEK(252)=208THENF$(I)="":PRINT"[212][207][207] [204][193][210][199][197][146]":GOTO156
  55. 154 F(I)=AD:AD=PEEK(251)+PEEK(252)*256:T(I)=AD
  56. 155 PRINTRIGHT$("   "+STR$(T(I)-F(I)),5);" BYTES OF MEM"
  57. 156 NEXTI
  58. 157 IFN=0GOTO189
  59. 158 PRINT"[208]LEASE INSERT THE [196][197][211][212][201][206][193][212][201][207][206][144] DISKETTE"
  60. 159 INPUT"[198][207][210][205][193][212][144] THIS DISKETTE  N[157][157][157]";A$
  61. 160 PRINT
  62. 161 IFA$<>"Y"GOTO165
  63. 162 INPUT" [196]ISK NAME,ID";F$,T$
  64. 163 PRINT#15,"N0:"+F$+","+T$
  65. 164 PRINT:GOSUB193:IFEGOTO157
  66. 165 FORI=1TON
  67. 166 IFF$(I)=""GOTO183
  68. 167 PRINT" ";Q$;F$(I);Q$;TAB(20);
  69. 168 OPEN1,8,2,F$(I)+",W"
  70. 169 GOSUB193:IFE=0GOTO176
  71. 170 CLOSE1:IFE=63THEN172
  72. 171 REM  CLOSE1:IFE<>63GOTO840
  73. 172 PRINT:INPUT" [210][197][208][204][193][195][197][144] EXISTING FILE [157]? N[157][157][157]";A$
  74. 173 PRINT
  75. 174 IFA$<>"Y"GOTO183
  76. 175 PRINT#15,"S0:"+F$(I):GOTO167
  77. 176 SZ=INT(F(I)/256)
  78. 177 POKE251,F(I)-SZ*256:POKE252,SZ
  79. 178 SZ=INT(T(I)/256)
  80. 179 POKE253,T(I)-SZ*256:POKE254,SZ
  81. 180 SYS828:GOSUB193:CLOSE1:IFE=72ORE=74GOTO184
  82. 181 IFEGOTO183
  83. 182 PRINTRIGHT$("   "+STR$(T(I)-F(I)),5);" BYTES OF MEM"
  84. 183 NEXTI
  85. 184 INPUT" [211]AVE SAME PROGRAMS AGAIN? N[157][157][157]";A$
  86. 185 IFA$="Y"GOTO157
  87. 186 CLOSE15:CLOSE1
  88. 187 INPUT" [205]ORE PROGRAMS TO COPY? Y[157][157][157]";A$
  89. 188 IFA$="Y"THEN CLOSE15:CLOSE1:GOTO107
  90. 189 PRINTTAB(14)"[197][206][196] [207][198] [195][207][208][217]"
  91. 190 PRINTTAB(7)"[208]LEASE REMOVE THE DISKETTE"
  92. 191 PRINTTAB(11)"FROM THE DISK DRIVE[144]"
  93. 192 PRINTCHR$(9);:END
  94. 193 INPUT#15,E,E$,E1,E2
  95. 194 IFE=0THENRETURN
  96. 195 EE$=MID$(STR$(E),2):E1$=MID$(STR$(E1),2):E2$=MID$(STR$(E2),2)
  97. 196 IFE=63THENRETURN
  98. 197 PRINT:PRINT"";EE$;",";E$;",";E1$;",";E2$
  99. 198 DATA 76,96,3,162,1,32,198,255,32
  100. 199 DATA 228,255,160,0,145,251,230
  101. 200 DATA 251,208,8,230,252,165,252
  102. 201 DATA 201,208,240,6,165,144,41,64
  103. 202 DATA 240,231,76,204,255,162,1,32
  104. 203 DATA 201,255,162,54,134,1,160,0
  105. 204 DATA 177,251,32,210,255,230,251
  106. 205 DATA 208,2,230,252,165,251,197,253
  107. 206 DATA 208,239,165,252,197,254,208
  108. 207 DATA 233,162,55,134,1,76,204,255
  109.